#include<iostream>
using namespace std;
class Solution {
public:
    int hammingWeight(uint32_t n) {
        double cnt = 0;
        while (n) {
            if ((n & 1) == 1)cnt++;
            n /= 2;
        }
        return cnt;
    }
};